INTRODUCTION... MK.lib for CLIPPER provides basic and advanced functions for Mouse programming like, using Mouse and Keyboard at the same time, user selectable cursor shapes. MK.lib may be nested as deep as you like. MK.lib 2.1 is $99.00 with free updates. To order MK.lib call... Programmer's Shop 1-800-421-8006 Aries Software 1-402-292-4349 LINKERS... MK.lib is compatible with the following. 1 plink86 2.24 2 Tlink 1.1, 3.0, 3.01 3 Blinker (All Versions) 4 Warplink 1.02 5 RTlink MOUSE DRIVERS.... According to Microsoft, Mouse driver 6.26 is buggy and They told us to use 6.24 or the newer 7.03 and 7.04. Driver 7.03 does a video check and can cause erratic movement. If this happens, 7.04 loaded with the /y switch will disable video checking. Any Mouse Microsoft compatible will work with MK.lib. INSTALLATION... Simply link MK.lib into your Application. If you are using overlays put MK.lib into the Root since you will be using the Mouse functions throughout the Application. NOTES... The Mouse will return a value of 501 for the left button and 502 for the right button. We use i as an example for a return valuein these functions. That is not to say all functions have to be called this way. It depends on how you want to do your error trapping. An example of calling a function both ways... i = mktrap(2,5,12,25) if !i && code here to warn that an invalid parameter was passed. endif OR mktrap(2,5,12,25) The first call reports back if an invalid parameter was passed, the second does not. The second will work if parameters are valid and do nothing if they are not. Its up to your coding style. Some functions are obvious, if you NEED a return value then the first call is the way to go. Functions like MKRESET() just do a task and thats all, so the second call is ok. FUNCTIONS... MKPRESS() Purpose... Polls MOUSE and KEYBOARD at the same time. Syntax.... = mkpress() Returns... Value of the button or key pressed. Notes..... , variable that holds value of mkpress() Can be used with just a Mouse or just a Keyboard. Sample.... i = mkpress() if i = 27 .or. i = 502 && Escape key or Right button quit endif MKSET() Purpose... Initializes Mouse if found. Turns ON or OFF Mouse. Syntax.... = mkset() Returns... .T. if mouse found else .F. Notes..... , variable that holds value of mkset(), Following an mkset() call, an error trap to warn if no Mouse Found should be used. Sample.... i = mkset() if !i @ 0,0 say "MOUSE not Found" endif Call mkset() before you Quit Your Application to DOS. MKCURSOR() Purpose... Turns On or Off MOUSE cursor. Syntax.... mkcursor() Returns... .F. if is not 0 or 1 else .T. Notes..... = 0 to turn cursor On or 1 to turn cursor Off. Turning cursor off to change screens, then on again will eliminate mouse tracks. Sample.... mkcursor(0) && Turn on cursor MKROW() Purpose... Gets ROW position. Syntax.... = mkrow() Returns... Value of the Row when a button was pressed. Notes..... , variable that holds value of mkrow(). Call this directly after calling mkpress(). Sample.... i = mkpress() && Get key or button press ii = mkrow() && Get row iii = mkcol() && Get column if i = 501 .and. ii = 40 .and. iii = 12 @ 24,0 say "I'm at the center of the screen" endif MKCOL() Purpose... Gets COLUMN position. Syntax.... = mkcol() Returns... Value of the Col when a button was pressed. Notes..... , variable that holds value of mkcol(). Call this directly after calling mkpress(). Sample.... See MKROW(). MKSETCURS() Purpose... Sets the cursor at X,Y position. Syntax.... mksetcurs(,) Returns... .F. if or invalid else .T. Notes..... = Row, = Column. Call as ,. Sample.... mksetcurs(16,64) && Sets cursor at row 16 and column 64. MKBTNDWN() Purpose... Tells which button is down at time of call. Syntax.... = mkbtndwn() Returns... 0 = None, 1 = Left, 2 = Right, 3 = Both. Notes..... , variable that holds value of mkbtndwn(). This is an extra function. MKPRESS() will do the same but we had requests for this so here it is. Sample.... i = mkbtndwn() if i = 1 @ 24,0 say "You pressed the Left button" endif MKBTNPRS() Purpose... Count times a Button was pressed since last call. Syntax.... = mkbtnprs() Returns... .F. if invalid else value of button press. Notes..... , variable that holds value of mkbtnprs() can be 0 = Left Button, 1 = Right Button. This sample shows number times the Left button was pressed. Sample.... i = mkbtnprs(0) time = 0 do while time # 2500 time = time + 1 && Press button as many time as you can enddo && during this loop. i = mkbtnprs(0) ? i MKBTNRLS() Purpose... Count times a Button was released since last call. Syntax.... = mkbtnrls() Returns... .F. if invalid else value of button releases. Notes..... , variable that holds value of mkbtnrls() 0 = Left Button, 1 = Right Button. Sample.... See MKBTNPRS(). MKTRAP() Purpose... Traps Mouse in Horizontal and/or Vertical positions. Syntax.... mktrap(,,,) Returns... .F. if thru invalid else .T. Notes..... =Top,=Left,=Bottom,=Right. Sample.... i = mktrap(0,0,5,15) if !i && code here if parameter invalid endif To return to full screen mode call as... mktrap(0,0,24,79) Note we called mktrap() without i to error trap. No reason for this we just did not error trap that call. MKSETSPD() Purpose... Sets Mouse Cursor Sensitivity and Double Speed Ratio. Syntax.... mksetspd(,,) Returns... .F. if , or in valid else .T. Notes..... =Horizontal speed,=Vertical speed, is for setting the Double Speed ratio. 1 to 100 is the range for , or . Sample.... mksetspd(10,10,15) && Slow mksetspd(80,80,90) && Fast mksetspd(50,50,64) && Normal speed MKCHKSPD() Purpose... Gets Mouse Cursor Sensitivity and Double Speed Ratio. Syntax.... mkchkspd() Returns... Current Value of else .F. if invalid. Notes..... 0 = Horizontal speed, 1 = Vertical speed, 2 = Double Speed ratio. Following shows Horizontal, Vertical and Double Speed ratio. Sample.... H = mksetspd(0) ? H V = mksetspd(1) ? V D = mksetspd(2) ? D MKMOTION() Purpose... Count Horizontal or Vertical Mickey Motion. Syntax.... = mkmotion() Returns... Current Value of else .F. if invalid. Notes..... , variable that holds value of mkmotion(). 0 = Horizontal, 1 = Vertical. Values can range from -32768 to 32767. Right = positive, Left = negative. Up = negative, Down = positive. Sample.... i = mkmotion(0) if i < 0 @ 24,0 say "You moved left" endif MKRESET() Purpose... Resets Mouse Software Only. Syntax.... mkreset() Returns... Nothing. Notes..... If you changed any attributes of the Mouse driver and want to return to normal setting, call mkreset() to do so without doing a hardware reset. Sample.... mkreset() MKFLDLOK() Purpose... Field Encryption/Decryption Syntax.... mkfldlok(,) Returns... An Encrypted or Decrypted Field Notes..... is the Character field name. = 0 to Decrypt and 1 to Encrypt. A blank space is returned if not valid. Be very CAREFUL !!! with this function. Sample.... use testdbf && open database mfname = fldlock(fname,0) && unlock field @ 2,2 say "Enter Name " get mfname && get new data read && read data replace fname with fldlock(mfname,1) && lock field use && close database MKSHAPE() Purpose... Change mouse cursor shape. Syntax.... mkshape() Returns... .F. if invalid else .T. Notes..... There are 13 shapes to choose from. They are... 1. Cross 8. Right Arrow 2. Check 9. Left Arrow 3. Asterisk 10. Up/Down Arrow 4. Diamond 11. Up Arrow 5. Hour Glass 12. Down Arrow 6. Small Circle 13. Standard Block (default) 7. Music Note Sample.... mkshape(4) && Change cursor to a diamond MKRANGE() Purpose... Tells if a button was pressed within defined range. Syntax.... mkrange(,,,) Returns... 0 if invalid, .F. if not in range, .T. if in range Notes..... =TOP,=LEFT,=BOTTOM,=RIGHT. if an invalid parameter is passed nothing happens. To test a range of row 9 by col 17 by row 11 by col 62 call as... Sample.... if !mkrange(9,17,11,62) && Code here if parameter invalid endif This is much faster than and replaces MKROW(), MKCOL(). You may also check a single point at row 3, col 14 with a call like... if !mkrange(3,14,3,14) && Code here if parameter invalid endif ----------------end-of-author's-documentation--------------- Software Library Information: This disk copy provided as a service of The Public (Software) Library We are not the authors of this program, nor are we associated with the author in any way other than as a distributor of the program in accordance with the author's terms of distribution. Please direct shareware payments and specific questions about this program to the author of the program, whose name appears elsewhere in this documentation. If you have trouble getting in touch with the author, we will do whatever we can to help you with your questions. All programs have been tested and do run. To report problems, please use the form that is in the file PROBLEM.DOC on many of our disks or in other written for- mat with screen printouts, if possible. The P(s)L cannot de- bug programs over the telephone. Disks in the P(s)L are updated monthly, so if you did not get this disk directly from the P(s)L, you should be aware that the files in this set may no longer be the current versions. For a copy of the latest monthly software library newsletter and a list of the 2,000+ disks in the library, call or write The Public (Software) Library P.O.Box 35705 Houston, TX 77235-5705 (713) 524-6394